
*     ***************************************************************** * 
*     ***************************************************************** * 
*       File-Name:      sweden.do                                       * 
*       Date:           April 5, 2019                                   * 
*       Author:         Bowler, Gschwend, Indridason                    * 
*       Purpose:      	Performs basic recoding of variables            * 
*                       and analysis of Swedish data                    *
* 	    Input File:                                                     * 
*       Data Output:                                                    *              
*     ****************************************************************  * 
*     ****************************************************************  * 



set more off
version 15.1
set mem 100m


* Sweden data thanks to Annika Freden

/*
It is OK to use the data from the Internet Campaign Panel. I attach it to this email. 
It is based on similar panel as I used for the publication I sent to you (Scandinavian Political Studies). 
I have reduced the original file to three waves: post EU-election (w2), 
week before election (w6), and just after election (w7), where the relevant variables were measured. 
For any further details of the datatset, please contact Stefan Dahlberg. stefan.dahlberg@pol.gu.se.
 
w6, in which the coalitions LR variables were included, were part of the one week before election panel.
The variables of particular interest are
 
W6q48 (voters own LR-placement)
W6q49_1until 6: LR placement of coalitions
1: Social Democrats, Greens
2: Moderates, Liberals, Centre, Christian Democrats
3: Social Democrats, Greeens, Centre, Liberals
4: Social Demcorats, Greens, Left
5: Social Democrats (single)
6: Scoial Democrats, Greens, Left, Feminist Initiative
 
See the attached screenshot for how the item appeared on the screen.
The first five coalitions were also measured at an earlier time point just before the 
EU election (w2q18_1 until 5)
*/




* There is one 2-party-coalition we can use, 
* namely the "Social Democrats, Greens"



use w2_w5_w6_w7_CampaignSweden.dta, clear

*l/r self placement w5q62 (N>5000)
sum w5q62

sum w6q48
gen lr_self = w6q48

sum w7q28

* l/r of parties (N>1200)
sum w5q54_1 - w5q54_9
sum w6q32_1 - w6q32_9



* l/r of coalitions (N>5000)
sum w2q18_1 - w2q18_6
sum w6q49_1 - w6q49_6

* l/r of parties (N>1400)
sum  w7q27_1 - w7q27_9
sum  w7q28      /* (N>5000) */


* WAVE 2:

des w2q18_1-w2q18_6

gen coal_sapgr2 = w2q18_1   /* SAP & Greens (MP) */
gen coal_sap2 = w2q18_6  /* SAP single party govt. */


*WAVE 5

des w5q54_1 - w5q54_9

gen lr_sap5 = w5q54_2  /* Social Democrats */
gen lr_gr5 = w5q54_6  /* Greens */

* WAVE 6
des w6q32_1 - w6q32_9

gen lr_sap6 = w6q32_2  /* Social Democrats */
gen lr_gr6 = w6q32_6  /* Greens */
gen lr_left6 = w6q32_4  /* Left Party */

gen dif = lr_sap6 - lr_gr6
sum dif
tab dif

* Voters do not agree which party is more to the left than the other party. Odd.


des w6q49_1 - w6q49_6

gen coal_sapgr6 = w6q49_1   /* SAP & Greens (MP) */
gen coal_sap6 = w6q49_5  /* SAP single party govt. */
gen coal_sapgrl6 = w6q49_4  /* SAP & Greens (MP) & Left Party */
gen coal_sapgrlf6 = w6q49_6  /* SAP & Greens (MP) & Left Party + Feminist Initiative */


tab coal_sap6 lr_sap6
sum coal_sap6 lr_sap6 if lr_sap6!=.


* WAVE 7
des w7q27_1 - w7q27_9

gen lr_sap7 = w7q27_2  /* Social Democrats */
gen lr_gr7 = w7q27_6  /* Greens */

gen lr_sap = lr_sap6
replace lr_sap = lr_sap5 if lr_sap6==.
replace lr_sap = lr_sap7 if lr_sap==.

gen lr_gr = lr_gr6
replace lr_gr = lr_gr5 if lr_gr6==.
replace lr_gr = lr_gr7 if lr_gr==.





*************************************
** Perceptions of Coalition Policy **
*************************************

** Comment in paper:
** Reliability of LR perceptions as respondents reported the perceived position of the 
** Social Democrat (SAP) – Green (MP) coalition in two waves (2 and 6) four months apart


gen dif_lr_sapgr62 = coal_sapgr6 - coal_sapgr2
tab dif_lr_sapgr62, mis
tab dif_lr_sapgr62

* How much difference between Wave 2 and Wave 6?
* 43% stay at the very same value!!! and 85% (20 + 43 + 22) with +/- 1 scale point. This is remarkable.




 
* SAP-Greens

sum coal_sapgr* lr_gr* lr_sap*
 

* Using all available waives
gen CB = coal_sapgr6 - lr_gr
gen AB = lr_sap - lr_gr


	reg CB AB, nocons
	eststo tab1
	test _b[AB] = .5
	
	
* Only wave 6	
gen CB6 = coal_sapgr6 - lr_gr6
gen AB6 = lr_sap6 - lr_gr6


	reg CB6 AB6, nocons
	eststo tab2
	test _b[AB6] = .5
	

* Result: \alpha < .5 no matter whether we look at wave 6 or all available waves.	
* Using only data from wave 6 is prefrred 


*****************************************************
*** Table A6: Estimated Coalition Weight (Sweden) ***
*****************************************************

#delimit ;
esttab tab2 using simplestS.tex, b(%9.3f) se(%9.3f) mtitles("SAP-Greens")
varlabels(AB6 "\alpha") subs("\alpha" "$\alpha\$")
alignment(D{.}{.}{-1}) sfmt(%9.2f)   
stats(N, fmt(%9.0f) labels("\sc Observations")) label 
booktabs title(\sc Estimated Coalition Weight (Sweden)  \label{tab:simplestS})
 replace nonotes addnote("Standard errors in parentheses. \sym{*}  p $< 0.10$, \sym{**} p $< 0.05$,  \sym{***} p $< 0.01$ given H\(_0\): \alpha = 0.5.")  
 star(* 0.10 ** 0.05 *** 0.01) nonum
 ;
#delimit cr




****************************************************************
*** Save data for generating table of decription in Appendix ***
****************************************************************

preserve
gen lfdn = idnr
gen country = "Sweden"
keep country lfdn coal_sapgr6 lr_gr6 lr_sap6 lr_left6  coal_sapgrl6 coal_sapgrlf6
keep if e(sample)
compress
save description_s, replace
restore







	
****************************************************************************************
***** How much do scholars go wrong assuming Gamson? Using election results of 2014 ****	
****************************************************************************************

gen range_sg = abs(lr_sap6 - lr_gr6)

	reg CB6 AB6, nocons
    gen coal_sapgr6_w = 	_b[AB6]*lr_sap6 + (1-_b[AB6])*lr_gr6   // our model prediction
	gen coal_sapgr6_hat = 	31.01/(31.01 + 6.89)*lr_sap6 + (1-31.01/(31.01 + 6.89))*lr_gr6
    gen coal_sapgr6_dif = coal_sapgr6_hat - coal_sapgr6_w
	gen coal_sapgr6_dif_abs = abs(coal_sapgr6_dif)
	gen coal_sapgr6_difs = abs(coal_sapgr6_dif)/range_sg  /* Difference rel. to absolute distance betwen parties*/
	

************************
*** Table 1 in paper ***
************************


** Values to replicate TABLE 1 
 sum coal_*_abs  
 sum coal_*_difs  
 
 
 * Difference between Gamson and actual placement of coalitons is 60% of the distance  between the parties.
 
exit
